<@override name="link">

<link href="${base}/resources/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
</@override>
<@override name="body">
<body class="gray-bg">
<div class="col-sm-12">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>人员管理</h5>
            <div class="ibox-tools">
                <a href="javascript:;" class="dropdown-toggle" title="添加岗位">
                    <i class="fa fa-arrows"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <form action="index.html">
                <div class="row">
                    <div class="col-sm-9 m-b-xs"></div>
                    <div class="col-sm-3">
                        <div class="input-group">
                            <input type="hidden" name="pageNumber" id="pageNumber" value="${pageable.pageNumber}">
                            <input type="hidden" name="pageSize" id="pageSize" value="${pageable.pageSize}">
                            <input type="text" placeholder="权限的名称" name="key" value="<#if key??>${key}</#if>" class="input-sm form-control">
                            <input type="hidden" name="check" value="<#if check??>${check}</#if>">
                            <span class="input-group-btn">
                                <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
                            </span>
                        </div>
                    </div>
                </div>
            </form>
            <table class="table table-striped">
                <thead>
                <tr>
                    <#if check??>
                        <td></td>
                    </#if>
                    <td>编号</td>
                    <td>名称</td>
                    <td>说明</td>
                    <td>上级岗位</td>
                    <td>创建时间</td>
                    <td>操作</td>
                </tr>
                </thead>
                <tbody>
                    <#list page.contents as position>
                        <tr>
                            <#if check??>
                                <td>
                                    <div class="<#if check=='ok'>radio<#else>checkbox</#if> i-checks">
                                        <input type="<#if check=='ok'>radio<#else>checkbox</#if>" name="id" data-id="${position.id}" data-name="${position.name}">
                                    </div>
                                </td>
                            </#if>
                            <td>
                                ${position.id}
                            </td>
                            <td>
                                ${position.name}
                            </td>
                            <td>${position.content}</td>
                            <td>
                                <#if position.parent??>
                                   <span class="label label-primary"> ${position.parent.name}</span>
                                <#else>
                                    暂无上级
                                </#if>
                            </td>
                            <td>
                                <#setting datetime_format="yyyy年MM月dd">
                                ${position.date?number_to_datetime}
                            </td>
                            <td>
                                <a href="javascript:;" class="btn btn-xs btn-primary" data-id="${position.id}" title="编辑">
                                    <i class="fa fa-edit"></i>
                                </a>
                                <a href="javascript:;" class="btn btn-xs btn-primary" data-id="${position.id}" title="添加下级岗位">
                                    <i class="fa fa-arrows"></i>
                                </a>
                                <a href="javascript:;" class="btn btn-xs btn-primary" data-id="${position.id}" title="删除岗位">
                                    <i class="fa fa-times-circle"></i>
                                </a>
                            </td>
                        </tr>
                    </#list>
                </tbody>
            </table>
        </div>
    </div>
</div>

<!-- 新增岗位的弹出框 -->
<div class="modal inmodal" id="addPosition" tabindex="1" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated fadeInDown">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span aria-hidden="true">&times;</span>
                    <span class="sr-only">Close</span>
                </button>
                <i class="fa fa-user-md modal-icon"></i>
                <h4 class="modal-title">添加管理员</h4>
            </div>
            <form action="submit" id="submitForm" method="post" class="form-horizontal">
                <div class="modal-body">
                    <div class="form-group">
                        <label for="" class="col-sm-3 control-label">
                            岗位名称
                        </label>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" name="name" id="positionName"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label for="" class="col-sm-3 control-label">
                            岗位说明
                        </label>
                        <div class="col-sm-8">
                            <textarea name="content" id="content" class="form-control" cols="30" rows="4"></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>

</body>
</@override>
<@override name="script">

<script type="text/javascript" src="${base}/resources/admin/js/plugins/iCheck/icheck.min.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/position.js"></script>
<script type="text/javascript">
    Position.submit();
    Common.checkbox();
</script>
</@override>
<@extends name="../base/main.html"/>